package com.example.demo;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface UserMapper
{
    @Select("select * from student")
    List<User>  selectUserByName();
    @Insert("insert into student(id, name, sex, age, classes) values(#{id}, #{name}, #{sex}, #{age}, #{classes})")
    boolean addUser(User user);
    //删除 按id删除
    @Delete("delete from student where id = #{id}")
    int deleteById(int id);
}

